package com.javaenzk.wfx.manager.mq;

import io.goeasy.GoEasy;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class MerchantMq {

    /**
     * 消息接受者，接收发送给目的地为merchant的消息
     */
    @JmsListener(destination="merchant")
    public  void merchant(String msg){

        System.out.println("接收：" + msg);

        //-----------------goeasy推送消息给商家页面，进行页面刷新，提醒上架发货-------------------
        GoEasy goEasy = new GoEasy("http://rest-hangzhou.goeasy.io", "BC-5c52046d1dcd46f19092000a173ef9e9");
        //参数1：发送消息的频道.merchantlist 表示消息只发给张三
        goEasy.publish("merchantlist", "success");

    }

}
